package com.njust.bean;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class IOCTest8 {

    private ConfigurableApplicationContext ioc;

    @Before
    public void tearUp(){
        ioc = new ClassPathXmlApplicationContext("config/ioc8.xml");
    }

    /**
     * 实验17：使用context:exclude-filter指定扫描包时不包含的类
     *
     * 因为只包含了@Service和@Repository，所以报如下错误：
     * org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'bookController' available
     */
    @Test
    public void test17(){
        Object bean = ioc.getBean("bookDao");
        System.out.println(bean);
        Object bean2 = ioc.getBean("bookService");
        System.out.println(bean2);
//        Object bean3 = ioc.getBean("bookController");
//        System.out.println(bean3);
    }
}
